<template>
  <div id="app">
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  name:'App',
  created() {
    if(this.$cookie.get('userId')){
      this.getUser();
    }
  },
  methods:{
    getUser(){
      this.axios.get('/user').then((res)=>{
        this.$store.dispatch('saveUsername',res.username)
      })
    }
  }
}
</script>

<style lang="scss">
@import "assets/scss/reset.scss";
</style>
